{extend name="public/base"}
{block name='main'}
<fieldset class="layui-elem-field layui-field-title" style="margin-top:0px;">
    <legend>{$menuid|getmenuname}</legend>
</fieldset>
<blockquote class="layui-elem-quote">保存设置说明：<br/>
    保存分为本地保存和阿里云oss保存，建议设置阿里云oss保存文件
</blockquote>
<form class="layui-form layui-form-pane" action="">
    <input type="hidden" name="menuid"  value="86"/>
    <div class="layui-form-item" pane="">
        <label class="layui-form-label">保存位置</label>
        <div class="layui-input-block">
            <input type="radio" title="阿里云oss" {if ($web_config.convert_type==1)}checked="checked"{/if} value="1" name="setting[convert_type]">
            <input type="radio" title="本地保存" {if ($web_config.convert_type==2)}checked="checked"{/if} value="2" name="setting[convert_type]">
        </div>
    </div>

    <div class="layui-form-item convert_type type_1" {if ($web_config.convert_type ==1)}style="display:block;"{else/}style="display:none;"{/if}>
        <label class="layui-form-label">appid</label>
        <div class="layui-input-block">
            <input type="text" name="setting[aliyun_accessId]" placeholder="请输入Appid" class="layui-input" value="{$web_config.aliyun_accessId}">
        </div>
    </div>

    <div class="layui-form-item convert_type type_1" {if ($web_config.convert_type ==1)}style="display:block;"{else/}style="display:none;"{/if}>
        <label class="layui-form-label">appsecret</label>
        <div class="layui-input-block">
            <textarea placeholder="请输入Appsecret" name="setting[aliyun_accessSecret]" class="layui-textarea">{$web_config.aliyun_accessSecret}</textarea>
        </div>
    </div>
    <div class="layui-form-item convert_type type_1" {if ($web_config.convert_type ==1)}style="display:block;"{else/}style="display:none;"{/if}>
        <label class="layui-form-label">endpoint</label>
        <div class="layui-input-block">
            <textarea placeholder="你的阿里云OSS地址" name="setting[aliyun_endpoint]" class="layui-textarea">{$web_config.aliyun_endpoint}</textarea>
        </div>
    </div>
    <!-- 本地保存说明 -->
    <div class="layui-form-item convert_type type_2" {if ($web_config.convert_type ==1)}style="display:none;"{/if}>
        <div class="layui-input-block">
            <blockquote class="layui-elem-quote layui-quote-nm">本地保存说明：<br/>
                选择本地保存，那么文件将保存在系统本地，建议使用阿里云oss
            </blockquote>
        </div>
    </div>
</div>

    <div class="layui-form-item">
        <label class=""></label>
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit="" lay-filter="upbtn">提交保存</button>
        </div>
    </div>
</form>
{include file='config/config_common'}
<script>
    //Demo
    layui.use(['layer','jquery','form'], function () {
        // 操作对象
        var layer = layui.layer,$ = layui.jquery,form = layui.form;
        form.on('radio', function (data) {
            $(".convert_type").hide();
            $(".type_" + data.value).show();
        });
    });
</script>
{/block}